//
//  STBuyCarHandle.m
//  CuiBoStore
//
//  Created by 崔博 on 16/12/13.
//  Copyright © 2016年 崔博. All rights reserved.
//

#import "STBuyCarHandle.h"
#import "STBuyCarListModel.h"
#import "STSureOrderModel.h"
@implementation STBuyCarHandle

+ (void)excuteBuyCarListSucess:(SucessBlock)sucess faile:(FailedBlock)fail
{
    NSString *memberID = [[NSUserDefaults standardUserDefaults] objectForKey:KMemberID];
    NSDictionary *dic = @{@"MemberId":memberID};
    [HttpTool postWithPath:BUYCARLIST params:dic success:^(id json) {
        NSArray *modelList = [STBuyCarListModel mj_objectArrayWithKeyValuesArray:json];
        sucess(modelList);
    } failure:^(NSError *error) {
        
    }];
}
+ (void)excuteAddBuyCarGoodsId:(NSString *)goodsId sucess:(SucessBlock)sucess faile:(FailedBlock)fail
{
    NSString *memberID = [[NSUserDefaults standardUserDefaults] objectForKey:KMemberID];
    NSDictionary *dic = @{@"MemberId":memberID,
                          @"GoodsId":goodsId};
    [HttpTool postWithPath:ADDBUYCAR params:dic success:^(id json) {
        
        sucess(json);
        
    } failure:^(NSError *error) {
        
    }];
}
+ (void)excuteDeleteBuyCarUpdateCartMsg:(NSString *)updateCartMsg sucess:(SucessBlock)sucess faile:(FailedBlock)fail
{
    NSDictionary *dic = @{@"updateCartMsg":updateCartMsg};
    [HttpTool postWithPath:DELETEBUYCAR params:dic success:^(id json) {
        
        sucess(json[@"result"]);
        
    } failure:^(NSError *error) {
        
    }];
}
+ (void)excutePayMoneyTypeProductInfor:(NSDictionary *)infor sucess:(SucessBlock)sucess faile:(FailedBlock)fail
{
    [HttpTool postWithPath:PAYMONEYTYPE params:infor success:^(id json) {
        
        STSureOrderModel *m = [STSureOrderModel mj_objectWithKeyValues:json];
        sucess(m);
    } failure:^(NSError *error) {
        
    }];
}
@end
